package com.groupseven.backend.services.impl;

import com.groupseven.backend.domain.Log.OperationLog;
import com.groupseven.backend.mapper.OperationLogMapper;
import com.groupseven.backend.services.OperationLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;

@Transactional
@Service
public class OperationLogServiceImpl implements OperationLogService {
    @Autowired
    private OperationLogMapper operationLogMapper;

    /**
     * @Author 王兆阳
     * @param operationLog
     * @return
     */
    public int insertOperationLog(OperationLog operationLog){
        return operationLogMapper.insertOperationLog(operationLog);
    }

    /**
     * @Author 王兆阳
     * @param username
     * @return
     */
    public int deleteOperationLog(String username){
        return operationLogMapper.deleteOperationLog(username);
    }

    /**
     * @Author 王兆阳
     * @return
     */
    public List<OperationLog> selectOperationLog(){
        return operationLogMapper.selectOperationLog();
    }
    /**
     * @Author 王兆阳
     * @return
     */
    public List<OperationLog> selectOperationByusername(String username){
        return operationLogMapper.selectOperationByusername(username);
    }

    public List<OperationLog> selectOperationBycreatetime(String createtime){
        return operationLogMapper.selectOperationBycreatetime(createtime);
    }

    public int deleteOperationLogBycreatetime(String createtime){
        return operationLogMapper.deleteOperationLogBycreatetime(createtime);
    }

    public int mutildelBycreatetimelist(List<Date> createtimes){
        return operationLogMapper.mutildelBycreatetimelist(createtimes);
    }

    public List<OperationLog> selectOperationBystimeandetime(Date stime, Date etime){
        return operationLogMapper.selectOperationBystimeandetime(stime,etime);
    }
}
